<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>已发布的调查问卷</title>

  <link rel="stylesheet" href="/statics/css/bootstrap.min.css">
  <link rel="stylesheet" href="/statics/css/users.css">
  <link rel="stylesheet" href="../layui/css/layui.css">
  <!-- 网页icon头像 -->
  <link rel="shortcut icon" href="/statics/img/loginOk.png">
  <style>
    #shareLinkLabel {
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
    }

    #shareLinkText {
      margin-top: 1rem;
    }
    /* 删除按钮 */
    #DeleteButton {
      width: 2rem;
      height: 2rem;
    }
    /* 详情按钮 */
    #detailsButton{
      width: 2rem;
      height: 2rem;
    }
  </style>


</head>

<body>

  <div id="container">

    <div class="layui-layout layui-layout-admin">
      <div class="layui-header layui-bg-black">
        <div class="layui-logo layui-hide-xs layui-bg-black">qs.xiaopangbupang.top</div>
        <!-- 头部区域（可配合layui 已有的水平导航） -->
        <ul class="layui-nav layui-layout-left">
          <!-- 移动端显示 -->
          <li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
            <i class="layui-icon layui-icon-spread-left"></i>
          </li>

          <li class="layui-nav-item layui-hide-xs"><a href="/home">首页</a></li>
          <li class="layui-nav-item layui-hide-xs"><a href="/home/personalDetails">个人信息</a></li>
          <li class="layui-nav-item layui-hide-xs"><a href="/home/publishQS">创建问卷调查</a></li>
          <li class="layui-nav-item">
            <a href="javascript:;">问卷管理</a>
            <dl class="layui-nav-child">
              <dd><a href="/home/userPubishQS">发布的问卷</a></dd>
              <dd><a href="/home/fillInQS">填写的问卷</a></dd>
            </dl>
          </li>
        </ul>
        <ul class="layui-nav layui-layout-right">
          <li class="layui-nav-item layui-hide layui-show-md-inline-block">
            <a href="javascript:;">
              <img src="../statics/img/userHeadPortrait.jpg" class="layui-nav-img">
              {{username}}
            </a>
            <dl class="layui-nav-child">
              <dd><a href="/home/updatePwd">修改密码</a></dd>
              <dd><a href="#" onclick="logOff()">注销</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
          </li>
        </ul>
      </div>

      <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
          <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
          <ul class="layui-nav layui-nav-tree" lay-filter="test">
            <li class="layui-nav-item layui-nav-itemed">
              <a href="javascript:;">问卷管理</a>
              <dl class="layui-nav-child">
                <dd><a href="/home/userPubishQS">已发布的调查问卷</a></dd>
                <dd><a href="/home/fillInQS">已填写的调查问卷</a></dd>
              </dl>
            </li>
            <li class="layui-nav-item"><a href="/home/inRegardToXiaoPang">关于小胖</a></li>
          </ul>
        </div>
      </div>

      <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
          <div class="row">
            <!-- 左布局 -->
            <div class="col-sm-3">
              <!-- 网页logo -->
              <img src="/statics/img/logo.gif" alt="" ondragend="return false" style="width: 5rem; height: 7rem;">
            </div>

            <!-- 中间布局 -->
            <div class="col-sm-6">

              <!-- 表格 -->
              <table class="layui-table">
                <colgroup>
                  <col width="150">
                  <col width="200">
                  <col>
                </colgroup>
                <thead>
                  <tr>
                    <th>发布问卷</th>
                    <th>发布时间</th>
                  </tr>
                </thead>
                <tbody>
                  {% for QS in currentUserQS %}
                  <tr>
                    <td>
                      <div class="layui-panel">
                        <div class="layui-card">
                          <div class="layui-card-header">问卷主题：{{QS.qsName}}</div>
                          <div class="layui-card-header">问卷简介：{{QS.qsSynopsis}}</div>
                          <div class="layui-card-body">
                            问卷编号：{{QS.id}}<br>
                            <div style="margin-left: 13rem;">
                              参与人数：{{QS.userSum}} 位
                                <button type="button" class="btn btn-outline-info" onclick="QS1('{{QS.id}}')"><img src="/statics/img/详情.png" alt="" id="detailsButton"></button>
                              <button type="button" class="btn btn-outline-danger" onclick="deleteButton('{{QS.id}}')"
                                style="margin-left: 1rem;"><img src="/statics/img/删除.png" id="DeleteButton"
                                  alt=""></button>
                            </div>

                            <div>
                              <label for="" id="shareLinkLabel">分享链接：</label>
                              <label for="" class="layui-bg-green"
                                id="shareLinkText">https://qs.xiaopangbupang.top/SQ1/?id={{QS.id}}</label>
                            </div>
                          </div>
                        </div>
                      </div>
                    </td>
                    <td>{{QS.createTime}}</td>
                  </tr>
                  {% endfor %}


                </tbody>
              </table>

            </div>

            <!-- 右布局 -->
            <div class="col-sm-3">

            </div>
          </div>
        </div>
      </div>
    </div>


  </div>


  <script src="/statics/js/jquery-3.6.0.min.js"></script>
  <!-- axios -->
  <script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>

  <script src="/statics/js/bootstrap.min.js"></script>
  <script src="/statics/js/SpiderWeb.js"></script>
  <script src="../layui/layui.js"></script>
  <script>
    layui.use(['layer', 'form'], function () {
      var layer = layui.layer
        , form = layui.form;
    });
  </script>

  <!-- 问卷一按钮 -->
  <script>
    // 点击详情的问卷Id
    var QS1 = function (qoeId) {
      axios({
        method: 'post',
        url: '/home/userPubishQSJudge',
        data: {
          qoeId
        }
      }).then(function (response) {
        var res = response.data;
        if (res.code === 200) {
          window.location.href = "/home/QSParticulars";
        }
      })
      // console.log(qoeId);

    }
  </script>

  <!-- 删除按钮点击事件 -->
  <script>
    function deleteButton(qsId) {
      layer.confirm('确定删除该问卷？', {
        btn: ['确定', '取消'] //可以无限个按钮
        , btn2: function (index, layero) {
          //按钮【按钮二】的回调
        }
      }, function (index, layero) {
        console.log(qsId);
        axios({
          method: 'post',
          url: '/home/userQsDelete',
          data: {
            qsId
          }
        }).then(function (response) {
          // axios工具下，服务器真正返回的数据在返回对象的data中
          var res = response.data;
          if (res.code === 200) {
            window.location.href = '/home/userPubishQS';
          }
        })
      });
    }

  </script>

  <script>
    // 注销按钮点击事件
    function logOff() {
      axios({
        method: 'post',
        url: '/logout'
      }).then(function (response) {
        // axios工具下，服务器真正返回的数据在返回对象的data中
        var res = response.data;
        if (res.code === 200) {
          window.location.href = '/';
        }
      })
    }
  </script>

  <!-- <script>
    // 用户名下面的错误提示函数
    function fn_errorSubmitForm(errorHint) {
      $('.errorSubmitForm').text(errorHint);
      $('.errorSubmitForm').removeClass('invisible');
      setTimeout(() => {
        $('.errorSubmitForm').addClass('invisible');
      }, 5000);
    }
  </script> -->
  <!-- 鼠标点击特效  -->
  <!-- <script type="text/javascript">
    var a_idx = 0;
    jQuery(document).ready(function ($) {
      $("body").click(function (e) {
        var a = new Array("(⌒▽⌒)", "(=・ω・=)", "(ﾟДﾟ≡ﾟдﾟ)!?", "Σ( ￣□￣||)", "(▔□▔)/", "Σ(ﾟдﾟ;)", "(^・ω・^ )", "（￣へ￣）", "(￣ε(#￣) Σ", "ヽ(`Д´)ﾉ", "(╯°口°)╯┴—┴", "🍕", "🍔", "🌭", "🥞", "🍳", "🍞", "🥐", "🍠", "🥙", "🍤", "🥩", "🍖", "🥂", "🥗", "🧀", "🍱", "🍝", "🐷", "❤", "🤣", "💕", "💖", "🌹", "💋", "🎂", "🎉", "🎃", "🎈", "🎀", "🎊", "🚗", "🎄", "❤", "💕", "💞", "💓", "💗", "💖", "💘", "💝", "💟", "💌", "🍟", "🍗", "🍿", "江呆呆是个憨憨💕💟💌");
        var $i = $("<span></span>").text(a[a_idx]);
        a_idx = (a_idx + 1) % a.length;
        var x = e.pageX,
          y = e.pageY;
        $i.css({
          "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
          "top": y - 20,
          "left": x,
          "position": "absolute",
          "font-weight": "bold",
          "color": "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
        });
        $("body").append($i);
        $i.animate({
          "top": y - 180,
          "opacity": 0
        },
          1500,
          function () {
            $i.remove();
          });
      });
    });
  </script> -->


</body>


</html>